﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using LimitlessLightSwitch.Resources;
using GalaSoft.MvvmLight;
using LimitlessLightSwitch.Helper;
using LimitlessLightSwitch.ViewModel;

namespace LimitlessLightSwitch
{
  public partial class RGBWRemoteView : PhoneApplicationPage
  {
    // Constructor
    public RGBWRemoteView()
    {
      InitializeComponent();

      // Sample code to localize the ApplicationBar
      BuildLocalizedApplicationBar();
    }

    // Sample code for building a localized ApplicationBar
    private void BuildLocalizedApplicationBar()
    {
      // Set the page's ApplicationBar to a new instance of ApplicationBar.
      ApplicationBar = new ApplicationBar();

      // Create a new menu item with the localized string from AppResources.
      ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
      appBarMenuItem.Click += appBarMenuItem_Click;
      ApplicationBar.MenuItems.Add(appBarMenuItem);
    }

    void appBarMenuItem_Click(object sender, EventArgs e)
    {
      NavigationService.Navigate(new Uri("/SettingsPage.xaml", UriKind.Relative), (this.DataContext as RGBWRemoteViewModel).Connector);
    }

  }
}